<?php
require_once 'vendor/autoload.php';

// 初始化应用
$app = new \think\App();
$app->initialize();

use think\facade\Db;

try {
    echo "检查Token加密状态...\n";
    
    // 查询token配置
    $configs = Db::table('system_configs')
        ->whereIn('config_key', ['xiaofeng_order_token', 'xiaofeng_create_order_token'])
        ->select();
    
    foreach ($configs as $config) {
        echo "\n配置键: {$config['config_key']}\n";
        echo "配置名称: {$config['config_name']}\n";
        echo "是否加密: " . ($config['is_encrypted'] ? '是' : '否') . "\n";
        echo "原始值: " . substr($config['config_value'], 0, 20) . "...\n";
        
        // 使用SystemConfig获取解密后的值
        $decryptedValue = \app\model\SystemConfig::getConfig($config['config_key']);
        echo "解密后值: " . substr($decryptedValue, 0, 20) . "...\n";
    }
    
} catch (Exception $e) {
    echo "错误: " . $e->getMessage() . "\n";
} 